package com.example.demo.day0219;

public class WhileTest {
    static boolean condition(){
        boolean result=Math.random()<0.99;//小于0.99的double类型的随机数
        System.out.println(result+",");
        return result;
    }
    public static void main(String[] args){
        while (condition())
            System.out.println("Inside'while'");//返回true继续执行
        System.out.println("Exited'while'");//返回false停止执行
    }

}
